{!capture name='main'!}
	<h1>{!$recipe.name!}</h1>
	<br/>
{!/capture!}
{!capture name='left'!}
	<img src="/static/picture/recipe/{!$recipe.recipeId!}" align="left" class="recipe_img2"/>
	<p>
	制作难度：{!$recipe.difficulty/2!}<br/>
	时间：{!$recipe.costTime!}
	</p>
	<p>{!$recipe.description!}</p>
	<div class="clr"></div>
	<h2>用料</h2>
	<table cellpadding="0" cellspacing="1" border="0" width="100%" class="ing">
		{!foreach from=$ingredients item=ing name=fe_ing!}
		<tr {!if $smarty.foreach.fe_ing.iteration%2==1!}class="td1"{!/if!}>
			<td width="25%">{!$ing.name!}</td>
			<td>{!$ing.weight!} 克</td>
		</tr>
		{!/foreach!}
	</table>
	<h2>制作方法</h2>
	<p>{!$recipe.directions!}</p>
	{!if $recipe.skill!}
	<h2>小帖士</h2>
	<p>{!$recipe.skill!}</p>
	{!/if!}
	<br/>
	<br/>
	<div class="dl">
	{!if $recipe.haveEdited>0!}
	<span class="g1">你已经编辑过该菜谱</span>，<a href="/wiki/{!$recipe.haveEdited!}">点击查看</a>
	{!else!}
	<span class="g1">如果你觉得这个菜谱还有待完善，可以</span> <a href="/recipe/{!$recipe.recipeId!}/edit">编辑菜谱</a>
	{!/if!}</div>
	
	{!if $actorList!}
	<h2>对这个菜谱有贡献的朋友</h2>
	<ul class="u h">
	{!foreach from=$actorList item=actor!}
		<li><a href="/people/{!$actor.actorId!}" title="{!$actor.nickname!}"><img src="/static/picture/people/{!$actor.actorId!}" alt="{!$actor.name!}"/></a></li>
	{!/foreach!}
	</ul>
	{!/if!}
{!/capture!}
{!capture name='right'!}
	<input type="button" value="{!if $recipe.haveFaved!}取消{!/if!}收藏" onclick="doFav(this)"/>&nbsp;
	{!if $recipe.haveDone > 0!}<a href="/food/{!$recipe.haveDone!}">我已经做过</a>{!else!}<input type="button" value="我做过" onclick="window.location='/recipe/{!$recipe.recipeId!}/upload';"/>{!/if!}

	{!if $tagList!}
	<h2>大家常给这道菜贴上的标签</h2>
	<ul class="u c">
	{!foreach from=$tagList item=tag!}
		<li><a href="/tag/{!$tag.name!}">{!$tag.name!}</a> <span class="g">({!$tag.num!})</span></li>
	{!/foreach!}
	</ul>
	{!/if!}

	{!if $foodList!}
	<h2>大家做的{!$recipe.name!}</h2>
	<ul class="u list ul_food">
	{!foreach from=$foodList item=food!}
	<li>
		<div class="l">
			<a href="/food/{!$food.foodId!}"><img src="/static/picture/food/{!$food.foodId!}_small?{!$food.updateTime!}" alt="{!$food.name!}" class="food_img"/></a>
		</div>
		<div class="r">
			<a href="/people/{!$food.actorId!}">{!$food.actorName!}</a> <span class="g">{!$food.createTime!}前</span>
			<p>{!$food.description!}</p>
		</div>	
	</li>
	{!/foreach!}
	</ul>
	{!/if!}
	
	{!if $loginActor || $remarkList!}
	<h2>大家对这道菜的评价</h2>
	{!/if!}
	<ul class="u list ul_people" id="remarkList">
	{!foreach from=$remarkList item=remark!}
	{!include file="part/remark.tpl"!}
	{!/foreach!}
	</ul>
	{!if $loginActor!}
	<form method="post" action="/action/remark/add" onsubmit="return $.action('remark.add',this);">
	<input type="hidden" name="recipeId" value="{!$recipe.recipeId!}"/>
	<input type="hidden" name="foodId" value="0"/>
	<textarea style="width:300px;height:140px;" name="content"></textarea><br/>
	<input type="submit" value="发表"/>
	</form>
	{!/if!}
{!/capture!}

{!capture name='jsCode'!}
<script type="text/javascript" src="/js/action.js"></script>
<script type="text/javascript" src="/js/floatpanel.js"></script>
<script type="text/javascript">
function doFav(sender){
	if (sender.value == "收藏") {
		$.action('fav.add',{!$recipe.recipeId!},sender);
	} else {
		if (confirm('你确定要删除这个收藏吗')) $.action('fav.cancel',{!$recipe.recipeId!},sender);
	}
}
</script>
{!/capture!}

{!include file='layouts/default.tpl'!}